{
 "cells": [
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "FileUpload doesn't work with vscode, please copy resulting database into `/tmp/jnw` directory."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "import cub \n",
    "\n",
    "from ipywidgets import widgets\n",
    "from IPython.display import display, clear_output\n",
    "\n",
    "if not os.path.exists('/tmp/jnw'):\n",
    "    os.mkdir('/tmp/jnw')\n",
    "os.chdir('/tmp/jnw')"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "To analyze results, let's select one algorithm first:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "9d392f48d3d34f5b9c69e040c246ccf1",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Dropdown(description='Algorithm:', options=('cub.bench.merge_sort.keys', 'cub.bench.merge_sort.pairs', 'cub.be…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "37521c7a22c34a2c803b2c661f378834",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Output()"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "storage = cub.bench.Storage()\n",
    "\n",
    "# Create a list of options for the dropdown menu\n",
    "algorithm_list = storage.algnames()\n",
    "\n",
    "# Create an output widget to display the dataframe\n",
    "output = widgets.Output()\n",
    "\n",
    "# Create the dropdown menu widget\n",
    "dropdown = widgets.Dropdown(\n",
    "    options=algorithm_list,\n",
    "    value=algorithm_list[0],\n",
    "    description='Algorithm:',\n",
    "    disabled=False,\n",
    ")\n",
    "\n",
    "global df\n",
    "\n",
    "df = storage.alg_to_df(algorithm_list[0])\n",
    "def on_dropdown_change(change):\n",
    "    global df\n",
    "    if change['type'] == 'change' and change['name'] == 'value':\n",
    "        df = storage.alg_to_df(change['new'])\n",
    "        with output:\n",
    "            clear_output()\n",
    "            # Display the selected dataframe column\n",
    "            display(df)\n",
    "\n",
    "# Attach the event handler to the dropdown menu\n",
    "dropdown.observe(on_dropdown_change)\n",
    "\n",
    "display(dropdown)\n",
    "\n",
    "with output:\n",
    "    display(df)\n",
    "\n",
    "display(output)"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now we should select a particular CTK, GPU and CUB:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "2e23b0f8960b4831bfd3ee7ffe343b07",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "HBox(children=(Dropdown(description='GPU:', options=('GeForce GTX 1070 (256)',), value='GeForce GTX 1070 (256)…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "gpus_list = df['gpu'].unique()\n",
    "ctks_list = df['ctk'].unique()\n",
    "cubs_list = df['cub'].unique()\n",
    "\n",
    "global gpu \n",
    "global ctk\n",
    "global cub\n",
    "\n",
    "gpu = gpus_list[0]\n",
    "ctk = ctks_list[0]\n",
    "cub = cubs_list[0]\n",
    "\n",
    "def create_dropdown_menu(name, options, callback):\n",
    "    dropdown = widgets.Dropdown(\n",
    "        options=options,\n",
    "        value=options[0],\n",
    "        description=name,\n",
    "        disabled=False)\n",
    "    dropdown.observe(callback)\n",
    "    return dropdown\n",
    "\n",
    "def on_gpu_change(change):\n",
    "    global gpu\n",
    "    if change['type'] == 'change' and change['name'] == 'value':\n",
    "        gpu = change['new']\n",
    "\n",
    "def on_ctk_change(change):\n",
    "    global ctk\n",
    "    if change['type'] == 'change' and change['name'] == 'value':\n",
    "        ctk = change['new']\n",
    "\n",
    "def on_cub_change(change):\n",
    "    global cub\n",
    "    if change['type'] == 'change' and change['name'] == 'value':\n",
    "        cub = change['new']\n",
    "\n",
    "gpu_dropdown = create_dropdown_menu('GPU:', gpus_list, on_gpu_change)\n",
    "ctk_dropdown = create_dropdown_menu('CTK:', ctks_list, on_ctk_change)\n",
    "cub_dropdown = create_dropdown_menu('CUB:', cubs_list, on_cub_change)\n",
    "\n",
    "dropdown_row = widgets.HBox([gpu_dropdown, ctk_dropdown, cub_dropdown])\n",
    "display(dropdown_row)"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Let's look at the data now"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>variant</th>\n",
       "      <th>elapsed</th>\n",
       "      <th>center</th>\n",
       "      <th>samples</th>\n",
       "      <th>T{ct}</th>\n",
       "      <th>OffsetT{ct}</th>\n",
       "      <th>Elements{io}[pow2]</th>\n",
       "      <th>Entropy</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>base</td>\n",
       "      <td>1.644118</td>\n",
       "      <td>0.000040</td>\n",
       "      <td>[3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...</td>\n",
       "      <td>I8</td>\n",
       "      <td>I32</td>\n",
       "      <td>16</td>\n",
       "      <td>1.000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>ipt_19.tpb_160</td>\n",
       "      <td>1.617769</td>\n",
       "      <td>0.000046</td>\n",
       "      <td>[3.8912e-05, 3.8912e-05, 3.8912e-05, 3.8912e-0...</td>\n",
       "      <td>I8</td>\n",
       "      <td>I32</td>\n",
       "      <td>16</td>\n",
       "      <td>1.000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>base</td>\n",
       "      <td>1.672030</td>\n",
       "      <td>0.000039</td>\n",
       "      <td>[3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...</td>\n",
       "      <td>I8</td>\n",
       "      <td>I32</td>\n",
       "      <td>16</td>\n",
       "      <td>0.811</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>ipt_19.tpb_160</td>\n",
       "      <td>1.616526</td>\n",
       "      <td>0.000046</td>\n",
       "      <td>[3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...</td>\n",
       "      <td>I8</td>\n",
       "      <td>I32</td>\n",
       "      <td>16</td>\n",
       "      <td>0.811</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>base</td>\n",
       "      <td>1.664673</td>\n",
       "      <td>0.000040</td>\n",
       "      <td>[3.6864003e-05, 3.7888003e-05, 3.7888003e-05, ...</td>\n",
       "      <td>I8</td>\n",
       "      <td>I32</td>\n",
       "      <td>16</td>\n",
       "      <td>0.544</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3331</th>\n",
       "      <td>ipt_15.tpb_576</td>\n",
       "      <td>1.416653</td>\n",
       "      <td>0.017443</td>\n",
       "      <td>[0.017391616, 0.017420288, 0.01742848, 0.01743...</td>\n",
       "      <td>I8</td>\n",
       "      <td>I64</td>\n",
       "      <td>28</td>\n",
       "      <td>0.811</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3332</th>\n",
       "      <td>ipt_15.tpb_576</td>\n",
       "      <td>1.767652</td>\n",
       "      <td>0.022247</td>\n",
       "      <td>[0.022086656, 0.022111233, 0.022162432, 0.0221...</td>\n",
       "      <td>I8</td>\n",
       "      <td>I64</td>\n",
       "      <td>28</td>\n",
       "      <td>0.544</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3333</th>\n",
       "      <td>ipt_15.tpb_576</td>\n",
       "      <td>2.066945</td>\n",
       "      <td>0.026129</td>\n",
       "      <td>[0.025906175, 0.0259072, 0.026003456, 0.026004...</td>\n",
       "      <td>I8</td>\n",
       "      <td>I64</td>\n",
       "      <td>28</td>\n",
       "      <td>0.337</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3334</th>\n",
       "      <td>ipt_15.tpb_576</td>\n",
       "      <td>2.367239</td>\n",
       "      <td>0.028263</td>\n",
       "      <td>[0.028086271, 0.02810163, 0.028107777, 0.02821...</td>\n",
       "      <td>I8</td>\n",
       "      <td>I64</td>\n",
       "      <td>28</td>\n",
       "      <td>0.201</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3335</th>\n",
       "      <td>ipt_15.tpb_576</td>\n",
       "      <td>1.816269</td>\n",
       "      <td>0.024484</td>\n",
       "      <td>[0.024112128, 0.024114177, 0.024117248, 0.0241...</td>\n",
       "      <td>I8</td>\n",
       "      <td>I64</td>\n",
       "      <td>28</td>\n",
       "      <td>0.000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>3336 rows × 8 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "             variant   elapsed    center  \\\n",
       "0               base  1.644118  0.000040   \n",
       "1     ipt_19.tpb_160  1.617769  0.000046   \n",
       "2               base  1.672030  0.000039   \n",
       "3     ipt_19.tpb_160  1.616526  0.000046   \n",
       "4               base  1.664673  0.000040   \n",
       "...              ...       ...       ...   \n",
       "3331  ipt_15.tpb_576  1.416653  0.017443   \n",
       "3332  ipt_15.tpb_576  1.767652  0.022247   \n",
       "3333  ipt_15.tpb_576  2.066945  0.026129   \n",
       "3334  ipt_15.tpb_576  2.367239  0.028263   \n",
       "3335  ipt_15.tpb_576  1.816269  0.024484   \n",
       "\n",
       "                                                samples T{ct} OffsetT{ct}  \\\n",
       "0     [3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...    I8         I32   \n",
       "1     [3.8912e-05, 3.8912e-05, 3.8912e-05, 3.8912e-0...    I8         I32   \n",
       "2     [3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...    I8         I32   \n",
       "3     [3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...    I8         I32   \n",
       "4     [3.6864003e-05, 3.7888003e-05, 3.7888003e-05, ...    I8         I32   \n",
       "...                                                 ...   ...         ...   \n",
       "3331  [0.017391616, 0.017420288, 0.01742848, 0.01743...    I8         I64   \n",
       "3332  [0.022086656, 0.022111233, 0.022162432, 0.0221...    I8         I64   \n",
       "3333  [0.025906175, 0.0259072, 0.026003456, 0.026004...    I8         I64   \n",
       "3334  [0.028086271, 0.02810163, 0.028107777, 0.02821...    I8         I64   \n",
       "3335  [0.024112128, 0.024114177, 0.024117248, 0.0241...    I8         I64   \n",
       "\n",
       "     Elements{io}[pow2] Entropy  \n",
       "0                    16   1.000  \n",
       "1                    16   1.000  \n",
       "2                    16   0.811  \n",
       "3                    16   0.811  \n",
       "4                    16   0.544  \n",
       "...                 ...     ...  \n",
       "3331                 28   0.811  \n",
       "3332                 28   0.544  \n",
       "3333                 28   0.337  \n",
       "3334                 28   0.201  \n",
       "3335                 28   0.000  \n",
       "\n",
       "[3336 rows x 8 columns]"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "alg_df = df.loc[(df['gpu'] == gpu) & (df['ctk'] == ctk) & (df['cub'] == cub) & (df['center'] != float('inf'))].copy()\n",
    "alg_df.drop(columns=['gpu', 'ctk', 'cub'], inplace=True)\n",
    "alg_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>variant</th>\n",
       "      <th>elapsed</th>\n",
       "      <th>center</th>\n",
       "      <th>samples</th>\n",
       "      <th>T{ct}</th>\n",
       "      <th>OffsetT{ct}</th>\n",
       "      <th>Elements{io}[pow2]</th>\n",
       "      <th>Entropy</th>\n",
       "      <th>base_samples</th>\n",
       "      <th>speedup</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>base</td>\n",
       "      <td>1.644118</td>\n",
       "      <td>0.000040</td>\n",
       "      <td>[3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...</td>\n",
       "      <td>I8</td>\n",
       "      <td>I32</td>\n",
       "      <td>16</td>\n",
       "      <td>1.000</td>\n",
       "      <td>[3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>ipt_19.tpb_160</td>\n",
       "      <td>1.617769</td>\n",
       "      <td>0.000046</td>\n",
       "      <td>[3.8912e-05, 3.8912e-05, 3.8912e-05, 3.8912e-0...</td>\n",
       "      <td>I8</td>\n",
       "      <td>I32</td>\n",
       "      <td>16</td>\n",
       "      <td>1.000</td>\n",
       "      <td>[3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...</td>\n",
       "      <td>0.866667</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>ipt_8.tpb_960</td>\n",
       "      <td>1.617064</td>\n",
       "      <td>0.000043</td>\n",
       "      <td>[3.584e-05, 3.584e-05, 3.584e-05, 3.584e-05, 3...</td>\n",
       "      <td>I8</td>\n",
       "      <td>I32</td>\n",
       "      <td>16</td>\n",
       "      <td>1.000</td>\n",
       "      <td>[3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...</td>\n",
       "      <td>0.928571</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>ipt_14.tpb_320</td>\n",
       "      <td>1.667154</td>\n",
       "      <td>0.000042</td>\n",
       "      <td>[3.4816e-05, 3.4816e-05, 3.4816e-05, 3.4816e-0...</td>\n",
       "      <td>I8</td>\n",
       "      <td>I32</td>\n",
       "      <td>16</td>\n",
       "      <td>1.000</td>\n",
       "      <td>[3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...</td>\n",
       "      <td>0.951220</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>ipt_10.tpb_576</td>\n",
       "      <td>1.667208</td>\n",
       "      <td>0.000042</td>\n",
       "      <td>[3.4816e-05, 3.4816e-05, 3.4816e-05, 3.4816e-0...</td>\n",
       "      <td>I8</td>\n",
       "      <td>I32</td>\n",
       "      <td>16</td>\n",
       "      <td>1.000</td>\n",
       "      <td>[3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...</td>\n",
       "      <td>0.951220</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3331</th>\n",
       "      <td>ipt_16.tpb_256</td>\n",
       "      <td>1.616577</td>\n",
       "      <td>0.022057</td>\n",
       "      <td>[0.022006784, 0.022012929, 0.022017023, 0.0220...</td>\n",
       "      <td>I8</td>\n",
       "      <td>I64</td>\n",
       "      <td>28</td>\n",
       "      <td>0.000</td>\n",
       "      <td>[0.009255935, 0.009261056, 0.009263105, 0.0092...</td>\n",
       "      <td>0.420706</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3332</th>\n",
       "      <td>ipt_20.tpb_448</td>\n",
       "      <td>1.666183</td>\n",
       "      <td>0.022471</td>\n",
       "      <td>[0.022202367, 0.022203391, 0.022276096, 0.0222...</td>\n",
       "      <td>I8</td>\n",
       "      <td>I64</td>\n",
       "      <td>28</td>\n",
       "      <td>0.000</td>\n",
       "      <td>[0.009255935, 0.009261056, 0.009263105, 0.0092...</td>\n",
       "      <td>0.412960</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3333</th>\n",
       "      <td>ipt_17.tpb_256</td>\n",
       "      <td>1.666830</td>\n",
       "      <td>0.022688</td>\n",
       "      <td>[0.022679552, 0.022679552, 0.022679552, 0.0226...</td>\n",
       "      <td>I8</td>\n",
       "      <td>I64</td>\n",
       "      <td>28</td>\n",
       "      <td>0.000</td>\n",
       "      <td>[0.009255935, 0.009261056, 0.009263105, 0.0092...</td>\n",
       "      <td>0.409009</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3334</th>\n",
       "      <td>ipt_15.tpb_544</td>\n",
       "      <td>1.666495</td>\n",
       "      <td>0.022356</td>\n",
       "      <td>[0.022345727, 0.022346752, 0.022349825, 0.0223...</td>\n",
       "      <td>I8</td>\n",
       "      <td>I64</td>\n",
       "      <td>28</td>\n",
       "      <td>0.000</td>\n",
       "      <td>[0.009255935, 0.009261056, 0.009263105, 0.0092...</td>\n",
       "      <td>0.415079</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3335</th>\n",
       "      <td>ipt_15.tpb_576</td>\n",
       "      <td>1.816269</td>\n",
       "      <td>0.024484</td>\n",
       "      <td>[0.024112128, 0.024114177, 0.024117248, 0.0241...</td>\n",
       "      <td>I8</td>\n",
       "      <td>I64</td>\n",
       "      <td>28</td>\n",
       "      <td>0.000</td>\n",
       "      <td>[0.009255935, 0.009261056, 0.009263105, 0.0092...</td>\n",
       "      <td>0.379005</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>3336 rows × 10 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "             variant   elapsed    center  \\\n",
       "0               base  1.644118  0.000040   \n",
       "1     ipt_19.tpb_160  1.617769  0.000046   \n",
       "2      ipt_8.tpb_960  1.617064  0.000043   \n",
       "3     ipt_14.tpb_320  1.667154  0.000042   \n",
       "4     ipt_10.tpb_576  1.667208  0.000042   \n",
       "...              ...       ...       ...   \n",
       "3331  ipt_16.tpb_256  1.616577  0.022057   \n",
       "3332  ipt_20.tpb_448  1.666183  0.022471   \n",
       "3333  ipt_17.tpb_256  1.666830  0.022688   \n",
       "3334  ipt_15.tpb_544  1.666495  0.022356   \n",
       "3335  ipt_15.tpb_576  1.816269  0.024484   \n",
       "\n",
       "                                                samples T{ct} OffsetT{ct}  \\\n",
       "0     [3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...    I8         I32   \n",
       "1     [3.8912e-05, 3.8912e-05, 3.8912e-05, 3.8912e-0...    I8         I32   \n",
       "2     [3.584e-05, 3.584e-05, 3.584e-05, 3.584e-05, 3...    I8         I32   \n",
       "3     [3.4816e-05, 3.4816e-05, 3.4816e-05, 3.4816e-0...    I8         I32   \n",
       "4     [3.4816e-05, 3.4816e-05, 3.4816e-05, 3.4816e-0...    I8         I32   \n",
       "...                                                 ...   ...         ...   \n",
       "3331  [0.022006784, 0.022012929, 0.022017023, 0.0220...    I8         I64   \n",
       "3332  [0.022202367, 0.022203391, 0.022276096, 0.0222...    I8         I64   \n",
       "3333  [0.022679552, 0.022679552, 0.022679552, 0.0226...    I8         I64   \n",
       "3334  [0.022345727, 0.022346752, 0.022349825, 0.0223...    I8         I64   \n",
       "3335  [0.024112128, 0.024114177, 0.024117248, 0.0241...    I8         I64   \n",
       "\n",
       "     Elements{io}[pow2] Entropy  \\\n",
       "0                    16   1.000   \n",
       "1                    16   1.000   \n",
       "2                    16   1.000   \n",
       "3                    16   1.000   \n",
       "4                    16   1.000   \n",
       "...                 ...     ...   \n",
       "3331                 28   0.000   \n",
       "3332                 28   0.000   \n",
       "3333                 28   0.000   \n",
       "3334                 28   0.000   \n",
       "3335                 28   0.000   \n",
       "\n",
       "                                           base_samples   speedup  \n",
       "0     [3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...  1.000000  \n",
       "1     [3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...  0.866667  \n",
       "2     [3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...  0.928571  \n",
       "3     [3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...  0.951220  \n",
       "4     [3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...  0.951220  \n",
       "...                                                 ...       ...  \n",
       "3331  [0.009255935, 0.009261056, 0.009263105, 0.0092...  0.420706  \n",
       "3332  [0.009255935, 0.009261056, 0.009263105, 0.0092...  0.412960  \n",
       "3333  [0.009255935, 0.009261056, 0.009263105, 0.0092...  0.409009  \n",
       "3334  [0.009255935, 0.009261056, 0.009263105, 0.0092...  0.415079  \n",
       "3335  [0.009255935, 0.009261056, 0.009263105, 0.0092...  0.379005  \n",
       "\n",
       "[3336 rows x 10 columns]"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "bench_columns = ['variant', 'elapsed', 'center', 'samples']\n",
    "workload_columns = [col for col in alg_df.columns if col not in bench_columns]\n",
    "# variants = alg_df['variant'].unique()\n",
    "\n",
    "base_df = alg_df[alg_df['variant'] == 'base'].drop(columns=['variant']).rename(columns={'center': 'base_center', 'samples': 'base_samples'})\n",
    "base_df.drop(columns=['elapsed'], inplace=True)\n",
    "\n",
    "merged_df = alg_df.merge(base_df, on=[col for col in alg_df.columns if col in workload_columns])\n",
    "merged_df['speedup'] = merged_df['base_center'] / merged_df['center']\n",
    "merged_df = merged_df.drop(columns=['base_center'])\n",
    "bench_columns.append('speedup')\n",
    "bench_columns.append('base_samples')\n",
    "merged_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "5cf0a28e9cd142b09be7d77c5b58fb6d",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "HBox(children=(Dropdown(description='T', options=('I8',), value='I8'), Dropdown(description='OffsetT', options…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import functools\n",
    "\n",
    "ct_axes_values = {}\n",
    "for col in merged_df.columns:\n",
    "    if '{ct}' in col:\n",
    "        ct_axes_values[col] = merged_df[col].unique()\n",
    "\n",
    "global ct_axes_chosen_values\n",
    "ct_axes_chosen_values = {}\n",
    "\n",
    "for ct_axis in ct_axes_values:\n",
    "    ct_axes_chosen_values[ct_axis] = ct_axes_values[ct_axis][0]\n",
    "\n",
    "def on_ct_value_change(ct_axis, change):\n",
    "    global ct_axes_chosen_values\n",
    "    if change['type'] == 'change' and change['name'] == 'value':\n",
    "        ct_axes_chosen_values[ct_axis] = change['new']\n",
    "\n",
    "ct_dropdowns = []\n",
    "for ct_axis in ct_axes_values:\n",
    "    ct_dropdowns.append(create_dropdown_menu(ct_axis.replace('{ct}', ''), ct_axes_values[ct_axis], functools.partial(on_ct_value_change, ct_axis)))\n",
    "\n",
    "ct_dropdown_row = widgets.HBox(ct_dropdowns)\n",
    "display(ct_dropdown_row)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>variant</th>\n",
       "      <th>elapsed</th>\n",
       "      <th>center</th>\n",
       "      <th>samples</th>\n",
       "      <th>Elements{io}[pow2]</th>\n",
       "      <th>Entropy</th>\n",
       "      <th>base_samples</th>\n",
       "      <th>speedup</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>base</td>\n",
       "      <td>1.644118</td>\n",
       "      <td>0.000040</td>\n",
       "      <td>[3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...</td>\n",
       "      <td>16</td>\n",
       "      <td>1.000</td>\n",
       "      <td>[3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>ipt_19.tpb_160</td>\n",
       "      <td>1.617769</td>\n",
       "      <td>0.000046</td>\n",
       "      <td>[3.8912e-05, 3.8912e-05, 3.8912e-05, 3.8912e-0...</td>\n",
       "      <td>16</td>\n",
       "      <td>1.000</td>\n",
       "      <td>[3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...</td>\n",
       "      <td>0.866667</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>ipt_8.tpb_960</td>\n",
       "      <td>1.617064</td>\n",
       "      <td>0.000043</td>\n",
       "      <td>[3.584e-05, 3.584e-05, 3.584e-05, 3.584e-05, 3...</td>\n",
       "      <td>16</td>\n",
       "      <td>1.000</td>\n",
       "      <td>[3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...</td>\n",
       "      <td>0.928571</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>ipt_14.tpb_320</td>\n",
       "      <td>1.667154</td>\n",
       "      <td>0.000042</td>\n",
       "      <td>[3.4816e-05, 3.4816e-05, 3.4816e-05, 3.4816e-0...</td>\n",
       "      <td>16</td>\n",
       "      <td>1.000</td>\n",
       "      <td>[3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...</td>\n",
       "      <td>0.951220</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>ipt_10.tpb_576</td>\n",
       "      <td>1.667208</td>\n",
       "      <td>0.000042</td>\n",
       "      <td>[3.4816e-05, 3.4816e-05, 3.4816e-05, 3.4816e-0...</td>\n",
       "      <td>16</td>\n",
       "      <td>1.000</td>\n",
       "      <td>[3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...</td>\n",
       "      <td>0.951220</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1819</th>\n",
       "      <td>ipt_24.tpb_1024</td>\n",
       "      <td>1.616816</td>\n",
       "      <td>0.022079</td>\n",
       "      <td>[0.022068225, 0.022069247, 0.022069247, 0.0220...</td>\n",
       "      <td>28</td>\n",
       "      <td>0.000</td>\n",
       "      <td>[0.009991168, 0.009993216, 0.009995264, 0.0099...</td>\n",
       "      <td>0.453437</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1820</th>\n",
       "      <td>ipt_24.tpb_576</td>\n",
       "      <td>1.716644</td>\n",
       "      <td>0.022847</td>\n",
       "      <td>[0.02249728, 0.022499328, 0.022675455, 0.02268...</td>\n",
       "      <td>28</td>\n",
       "      <td>0.000</td>\n",
       "      <td>[0.009991168, 0.009993216, 0.009995264, 0.0099...</td>\n",
       "      <td>0.438195</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1821</th>\n",
       "      <td>ipt_22.tpb_128</td>\n",
       "      <td>1.816621</td>\n",
       "      <td>0.024490</td>\n",
       "      <td>[0.024477696, 0.024480768, 0.024481792, 0.0244...</td>\n",
       "      <td>28</td>\n",
       "      <td>0.000</td>\n",
       "      <td>[0.009991168, 0.009993216, 0.009995264, 0.0099...</td>\n",
       "      <td>0.408806</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1822</th>\n",
       "      <td>ipt_23.tpb_512</td>\n",
       "      <td>1.666552</td>\n",
       "      <td>0.022298</td>\n",
       "      <td>[0.02228736, 0.022290433, 0.022291455, 0.02229...</td>\n",
       "      <td>28</td>\n",
       "      <td>0.000</td>\n",
       "      <td>[0.009991168, 0.009993216, 0.009995264, 0.0099...</td>\n",
       "      <td>0.449001</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1823</th>\n",
       "      <td>ipt_24.tpb_320</td>\n",
       "      <td>1.666686</td>\n",
       "      <td>0.022458</td>\n",
       "      <td>[0.022228992, 0.022247422, 0.022256639, 0.0222...</td>\n",
       "      <td>28</td>\n",
       "      <td>0.000</td>\n",
       "      <td>[0.009991168, 0.009993216, 0.009995264, 0.0099...</td>\n",
       "      <td>0.445787</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1824 rows × 8 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "              variant   elapsed    center  \\\n",
       "0                base  1.644118  0.000040   \n",
       "1      ipt_19.tpb_160  1.617769  0.000046   \n",
       "2       ipt_8.tpb_960  1.617064  0.000043   \n",
       "3      ipt_14.tpb_320  1.667154  0.000042   \n",
       "4      ipt_10.tpb_576  1.667208  0.000042   \n",
       "...               ...       ...       ...   \n",
       "1819  ipt_24.tpb_1024  1.616816  0.022079   \n",
       "1820   ipt_24.tpb_576  1.716644  0.022847   \n",
       "1821   ipt_22.tpb_128  1.816621  0.024490   \n",
       "1822   ipt_23.tpb_512  1.666552  0.022298   \n",
       "1823   ipt_24.tpb_320  1.666686  0.022458   \n",
       "\n",
       "                                                samples Elements{io}[pow2]  \\\n",
       "0     [3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...                 16   \n",
       "1     [3.8912e-05, 3.8912e-05, 3.8912e-05, 3.8912e-0...                 16   \n",
       "2     [3.584e-05, 3.584e-05, 3.584e-05, 3.584e-05, 3...                 16   \n",
       "3     [3.4816e-05, 3.4816e-05, 3.4816e-05, 3.4816e-0...                 16   \n",
       "4     [3.4816e-05, 3.4816e-05, 3.4816e-05, 3.4816e-0...                 16   \n",
       "...                                                 ...                ...   \n",
       "1819  [0.022068225, 0.022069247, 0.022069247, 0.0220...                 28   \n",
       "1820  [0.02249728, 0.022499328, 0.022675455, 0.02268...                 28   \n",
       "1821  [0.024477696, 0.024480768, 0.024481792, 0.0244...                 28   \n",
       "1822  [0.02228736, 0.022290433, 0.022291455, 0.02229...                 28   \n",
       "1823  [0.022228992, 0.022247422, 0.022256639, 0.0222...                 28   \n",
       "\n",
       "     Entropy                                       base_samples   speedup  \n",
       "0      1.000  [3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...  1.000000  \n",
       "1      1.000  [3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...  0.866667  \n",
       "2      1.000  [3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...  0.928571  \n",
       "3      1.000  [3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...  0.951220  \n",
       "4      1.000  [3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...  0.951220  \n",
       "...      ...                                                ...       ...  \n",
       "1819   0.000  [0.009991168, 0.009993216, 0.009995264, 0.0099...  0.453437  \n",
       "1820   0.000  [0.009991168, 0.009993216, 0.009995264, 0.0099...  0.438195  \n",
       "1821   0.000  [0.009991168, 0.009993216, 0.009995264, 0.0099...  0.408806  \n",
       "1822   0.000  [0.009991168, 0.009993216, 0.009995264, 0.0099...  0.449001  \n",
       "1823   0.000  [0.009991168, 0.009993216, 0.009995264, 0.0099...  0.445787  \n",
       "\n",
       "[1824 rows x 8 columns]"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tuning_df_loc = None \n",
    "\n",
    "for ct_axis in ct_axes_values:\n",
    "    if tuning_df_loc is None:\n",
    "        tuning_df_loc = (merged_df[ct_axis] == ct_axes_chosen_values[ct_axis])\n",
    "    else:\n",
    "        tuning_df_loc = tuning_df_loc & (merged_df[ct_axis] == ct_axes_chosen_values[ct_axis])\n",
    "\n",
    "tuning_df = merged_df.loc[tuning_df_loc].copy()\n",
    "\n",
    "for ct_axis in ct_axes_values:\n",
    "    tuning_df.drop(columns=[ct_axis], inplace=True)\n",
    "\n",
    "tuning_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>variant</th>\n",
       "      <th>elapsed</th>\n",
       "      <th>center</th>\n",
       "      <th>samples</th>\n",
       "      <th>Elements{io}[pow2]</th>\n",
       "      <th>Entropy</th>\n",
       "      <th>base_samples</th>\n",
       "      <th>speedup</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>43</th>\n",
       "      <td>ipt_14.tpb_352</td>\n",
       "      <td>1.667097</td>\n",
       "      <td>0.000042</td>\n",
       "      <td>[3.4816e-05, 3.4816e-05, 3.4816e-05, 3.4816e-0...</td>\n",
       "      <td>16</td>\n",
       "      <td>1.000</td>\n",
       "      <td>[3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...</td>\n",
       "      <td>0.951220</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>46</th>\n",
       "      <td>ipt_17.tpb_256</td>\n",
       "      <td>1.666077</td>\n",
       "      <td>0.000042</td>\n",
       "      <td>[3.4816e-05, 3.4816e-05, 3.4816e-05, 3.4816e-0...</td>\n",
       "      <td>16</td>\n",
       "      <td>1.000</td>\n",
       "      <td>[3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...</td>\n",
       "      <td>0.951220</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>119</th>\n",
       "      <td>ipt_14.tpb_352</td>\n",
       "      <td>1.666118</td>\n",
       "      <td>0.000043</td>\n",
       "      <td>[3.4816e-05, 3.4816e-05, 3.4816e-05, 3.4816e-0...</td>\n",
       "      <td>16</td>\n",
       "      <td>0.811</td>\n",
       "      <td>[3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...</td>\n",
       "      <td>0.904762</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>122</th>\n",
       "      <td>ipt_17.tpb_256</td>\n",
       "      <td>1.616790</td>\n",
       "      <td>0.000044</td>\n",
       "      <td>[3.584e-05, 3.6864003e-05, 3.6864003e-05, 3.68...</td>\n",
       "      <td>16</td>\n",
       "      <td>0.811</td>\n",
       "      <td>[3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...</td>\n",
       "      <td>0.883721</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>195</th>\n",
       "      <td>ipt_14.tpb_352</td>\n",
       "      <td>1.666390</td>\n",
       "      <td>0.000043</td>\n",
       "      <td>[3.584e-05, 3.584e-05, 3.584e-05, 3.584e-05, 3...</td>\n",
       "      <td>16</td>\n",
       "      <td>0.544</td>\n",
       "      <td>[3.6864003e-05, 3.7888003e-05, 3.7888003e-05, ...</td>\n",
       "      <td>0.928571</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>198</th>\n",
       "      <td>ipt_17.tpb_256</td>\n",
       "      <td>1.666235</td>\n",
       "      <td>0.000044</td>\n",
       "      <td>[3.6864003e-05, 3.6864003e-05, 3.6864003e-05, ...</td>\n",
       "      <td>16</td>\n",
       "      <td>0.544</td>\n",
       "      <td>[3.6864003e-05, 3.7888003e-05, 3.7888003e-05, ...</td>\n",
       "      <td>0.906977</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>271</th>\n",
       "      <td>ipt_14.tpb_352</td>\n",
       "      <td>1.666675</td>\n",
       "      <td>0.000043</td>\n",
       "      <td>[3.584e-05, 3.584e-05, 3.584e-05, 3.584e-05, 3...</td>\n",
       "      <td>16</td>\n",
       "      <td>0.337</td>\n",
       "      <td>[3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...</td>\n",
       "      <td>0.928571</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>274</th>\n",
       "      <td>ipt_17.tpb_256</td>\n",
       "      <td>1.616154</td>\n",
       "      <td>0.000044</td>\n",
       "      <td>[3.6864003e-05, 3.6864003e-05, 3.6864003e-05, ...</td>\n",
       "      <td>16</td>\n",
       "      <td>0.337</td>\n",
       "      <td>[3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...</td>\n",
       "      <td>0.906977</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>347</th>\n",
       "      <td>ipt_14.tpb_352</td>\n",
       "      <td>1.666453</td>\n",
       "      <td>0.000043</td>\n",
       "      <td>[3.584e-05, 3.584e-05, 3.584e-05, 3.584e-05, 3...</td>\n",
       "      <td>16</td>\n",
       "      <td>0.201</td>\n",
       "      <td>[3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...</td>\n",
       "      <td>0.928571</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>350</th>\n",
       "      <td>ipt_17.tpb_256</td>\n",
       "      <td>1.616455</td>\n",
       "      <td>0.000045</td>\n",
       "      <td>[3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...</td>\n",
       "      <td>16</td>\n",
       "      <td>0.201</td>\n",
       "      <td>[3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...</td>\n",
       "      <td>0.886364</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>423</th>\n",
       "      <td>ipt_14.tpb_352</td>\n",
       "      <td>1.666218</td>\n",
       "      <td>0.000043</td>\n",
       "      <td>[3.4816e-05, 3.4816e-05, 3.4816e-05, 3.4816e-0...</td>\n",
       "      <td>16</td>\n",
       "      <td>0.000</td>\n",
       "      <td>[2.4576e-05, 2.4576e-05, 2.4576e-05, 2.4576e-0...</td>\n",
       "      <td>0.595238</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>426</th>\n",
       "      <td>ipt_17.tpb_256</td>\n",
       "      <td>1.616859</td>\n",
       "      <td>0.000043</td>\n",
       "      <td>[3.584e-05, 3.584e-05, 3.584e-05, 3.584e-05, 3...</td>\n",
       "      <td>16</td>\n",
       "      <td>0.000</td>\n",
       "      <td>[2.4576e-05, 2.4576e-05, 2.4576e-05, 2.4576e-0...</td>\n",
       "      <td>0.595238</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>499</th>\n",
       "      <td>ipt_14.tpb_352</td>\n",
       "      <td>1.415810</td>\n",
       "      <td>0.000078</td>\n",
       "      <td>[6.9632e-05, 6.9632e-05, 6.9632e-05, 6.9632e-0...</td>\n",
       "      <td>20</td>\n",
       "      <td>1.000</td>\n",
       "      <td>[0.000110592, 0.000110592, 0.000110592, 0.0001...</td>\n",
       "      <td>1.578947</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>502</th>\n",
       "      <td>ipt_17.tpb_256</td>\n",
       "      <td>1.416047</td>\n",
       "      <td>0.000076</td>\n",
       "      <td>[6.8608e-05, 6.8608e-05, 6.9632e-05, 6.9632e-0...</td>\n",
       "      <td>20</td>\n",
       "      <td>1.000</td>\n",
       "      <td>[0.000110592, 0.000110592, 0.000110592, 0.0001...</td>\n",
       "      <td>1.621621</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>575</th>\n",
       "      <td>ipt_14.tpb_352</td>\n",
       "      <td>1.416357</td>\n",
       "      <td>0.000086</td>\n",
       "      <td>[7.8847996e-05, 7.8847996e-05, 7.8847996e-05, ...</td>\n",
       "      <td>20</td>\n",
       "      <td>0.811</td>\n",
       "      <td>[0.000118784, 0.000119808006, 0.000119808006, ...</td>\n",
       "      <td>1.404762</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>578</th>\n",
       "      <td>ipt_17.tpb_256</td>\n",
       "      <td>1.415771</td>\n",
       "      <td>0.000085</td>\n",
       "      <td>[7.7824e-05, 7.8847996e-05, 7.8847996e-05, 7.8...</td>\n",
       "      <td>20</td>\n",
       "      <td>0.811</td>\n",
       "      <td>[0.000118784, 0.000119808006, 0.000119808006, ...</td>\n",
       "      <td>1.421687</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>651</th>\n",
       "      <td>ipt_14.tpb_352</td>\n",
       "      <td>1.367251</td>\n",
       "      <td>0.000104</td>\n",
       "      <td>[9.6256e-05, 9.7280004e-05, 9.7280004e-05, 9.7...</td>\n",
       "      <td>20</td>\n",
       "      <td>0.544</td>\n",
       "      <td>[0.000119808006, 0.000119808006, 0.00011980800...</td>\n",
       "      <td>1.166667</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>654</th>\n",
       "      <td>ipt_17.tpb_256</td>\n",
       "      <td>1.366859</td>\n",
       "      <td>0.000102</td>\n",
       "      <td>[9.5232004e-05, 9.5232004e-05, 9.5232004e-05, ...</td>\n",
       "      <td>20</td>\n",
       "      <td>0.544</td>\n",
       "      <td>[0.000119808006, 0.000119808006, 0.00011980800...</td>\n",
       "      <td>1.190000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>727</th>\n",
       "      <td>ipt_14.tpb_352</td>\n",
       "      <td>1.366081</td>\n",
       "      <td>0.000123</td>\n",
       "      <td>[0.000110592, 0.000111616, 0.000111616, 0.0001...</td>\n",
       "      <td>20</td>\n",
       "      <td>0.337</td>\n",
       "      <td>[0.000117760006, 0.000118784, 0.000118784, 0.0...</td>\n",
       "      <td>0.983333</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>730</th>\n",
       "      <td>ipt_17.tpb_256</td>\n",
       "      <td>1.366657</td>\n",
       "      <td>0.000120</td>\n",
       "      <td>[0.000109568, 0.000109568, 0.000110592, 0.0001...</td>\n",
       "      <td>20</td>\n",
       "      <td>0.337</td>\n",
       "      <td>[0.000117760006, 0.000118784, 0.000118784, 0.0...</td>\n",
       "      <td>1.008547</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>803</th>\n",
       "      <td>ipt_14.tpb_352</td>\n",
       "      <td>1.365597</td>\n",
       "      <td>0.000127</td>\n",
       "      <td>[0.000119808006, 0.000120832, 0.000120832, 0.0...</td>\n",
       "      <td>20</td>\n",
       "      <td>0.201</td>\n",
       "      <td>[0.000119808006, 0.000119808006, 0.00011980800...</td>\n",
       "      <td>0.959677</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>806</th>\n",
       "      <td>ipt_17.tpb_256</td>\n",
       "      <td>1.365572</td>\n",
       "      <td>0.000126</td>\n",
       "      <td>[0.000118784, 0.000118784, 0.000118784, 0.0001...</td>\n",
       "      <td>20</td>\n",
       "      <td>0.201</td>\n",
       "      <td>[0.000119808006, 0.000119808006, 0.00011980800...</td>\n",
       "      <td>0.967480</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>879</th>\n",
       "      <td>ipt_14.tpb_352</td>\n",
       "      <td>1.316359</td>\n",
       "      <td>0.000120</td>\n",
       "      <td>[0.00011264, 0.00011264, 0.00011264, 0.0001126...</td>\n",
       "      <td>20</td>\n",
       "      <td>0.000</td>\n",
       "      <td>[4.9152e-05, 4.9152e-05, 4.9152e-05, 4.9152e-0...</td>\n",
       "      <td>0.427350</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>882</th>\n",
       "      <td>ipt_17.tpb_256</td>\n",
       "      <td>1.316560</td>\n",
       "      <td>0.000119</td>\n",
       "      <td>[0.000111616, 0.000111616, 0.000111616, 0.0001...</td>\n",
       "      <td>20</td>\n",
       "      <td>0.000</td>\n",
       "      <td>[4.9152e-05, 4.9152e-05, 4.9152e-05, 4.9152e-0...</td>\n",
       "      <td>0.431034</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>955</th>\n",
       "      <td>ipt_14.tpb_352</td>\n",
       "      <td>1.265653</td>\n",
       "      <td>0.000742</td>\n",
       "      <td>[0.00071168, 0.00071168, 0.000713728, 0.000714...</td>\n",
       "      <td>24</td>\n",
       "      <td>1.000</td>\n",
       "      <td>[0.00142848, 0.001429504, 0.001431552, 0.00143...</td>\n",
       "      <td>1.962759</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>958</th>\n",
       "      <td>ipt_17.tpb_256</td>\n",
       "      <td>1.265422</td>\n",
       "      <td>0.000750</td>\n",
       "      <td>[0.00072499196, 0.000726016, 0.00072704, 0.000...</td>\n",
       "      <td>24</td>\n",
       "      <td>1.000</td>\n",
       "      <td>[0.00142848, 0.001429504, 0.001431552, 0.00143...</td>\n",
       "      <td>1.943989</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1031</th>\n",
       "      <td>ipt_14.tpb_352</td>\n",
       "      <td>1.266642</td>\n",
       "      <td>0.000843</td>\n",
       "      <td>[0.00082841597, 0.00082944, 0.00082944, 0.0008...</td>\n",
       "      <td>24</td>\n",
       "      <td>0.811</td>\n",
       "      <td>[0.001435648, 0.0014366719, 0.0014366719, 0.00...</td>\n",
       "      <td>1.730255</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1034</th>\n",
       "      <td>ipt_17.tpb_256</td>\n",
       "      <td>1.265898</td>\n",
       "      <td>0.000853</td>\n",
       "      <td>[0.00083968, 0.00084172795, 0.00084172795, 0.0...</td>\n",
       "      <td>24</td>\n",
       "      <td>0.811</td>\n",
       "      <td>[0.001435648, 0.0014366719, 0.0014366719, 0.00...</td>\n",
       "      <td>1.709484</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1107</th>\n",
       "      <td>ipt_14.tpb_352</td>\n",
       "      <td>1.265562</td>\n",
       "      <td>0.001140</td>\n",
       "      <td>[0.001132544, 0.001133568, 0.001133568, 0.0011...</td>\n",
       "      <td>24</td>\n",
       "      <td>0.544</td>\n",
       "      <td>[0.001430528, 0.001432576, 0.001434624, 0.0014...</td>\n",
       "      <td>1.279874</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1110</th>\n",
       "      <td>ipt_17.tpb_256</td>\n",
       "      <td>1.266333</td>\n",
       "      <td>0.001140</td>\n",
       "      <td>[0.001132544, 0.001132544, 0.001132544, 0.0011...</td>\n",
       "      <td>24</td>\n",
       "      <td>0.544</td>\n",
       "      <td>[0.001430528, 0.001432576, 0.001434624, 0.0014...</td>\n",
       "      <td>1.279874</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1183</th>\n",
       "      <td>ipt_14.tpb_352</td>\n",
       "      <td>1.265758</td>\n",
       "      <td>0.001382</td>\n",
       "      <td>[0.001375232, 0.001375232, 0.001375232, 0.0013...</td>\n",
       "      <td>24</td>\n",
       "      <td>0.337</td>\n",
       "      <td>[0.0014172159, 0.001419264, 0.001421312, 0.001...</td>\n",
       "      <td>1.047407</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1186</th>\n",
       "      <td>ipt_17.tpb_256</td>\n",
       "      <td>1.265617</td>\n",
       "      <td>0.001369</td>\n",
       "      <td>[0.001362944, 0.001362944, 0.001362944, 0.0013...</td>\n",
       "      <td>24</td>\n",
       "      <td>0.337</td>\n",
       "      <td>[0.0014172159, 0.001419264, 0.001421312, 0.001...</td>\n",
       "      <td>1.057592</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1259</th>\n",
       "      <td>ipt_14.tpb_352</td>\n",
       "      <td>1.265935</td>\n",
       "      <td>0.001530</td>\n",
       "      <td>[0.0015226881, 0.0015226881, 0.0015226881, 0.0...</td>\n",
       "      <td>24</td>\n",
       "      <td>0.201</td>\n",
       "      <td>[0.001415168, 0.0014172159, 0.001419264, 0.001...</td>\n",
       "      <td>0.947791</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1262</th>\n",
       "      <td>ipt_17.tpb_256</td>\n",
       "      <td>1.265464</td>\n",
       "      <td>0.001510</td>\n",
       "      <td>[0.001504256, 0.001504256, 0.001504256, 0.0015...</td>\n",
       "      <td>24</td>\n",
       "      <td>0.201</td>\n",
       "      <td>[0.001415168, 0.0014172159, 0.001419264, 0.001...</td>\n",
       "      <td>0.960000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1335</th>\n",
       "      <td>ipt_14.tpb_352</td>\n",
       "      <td>1.215466</td>\n",
       "      <td>0.001463</td>\n",
       "      <td>[0.001455104, 0.001456128, 0.001456128, 0.0014...</td>\n",
       "      <td>24</td>\n",
       "      <td>0.000</td>\n",
       "      <td>[0.00064716797, 0.00064716797, 0.00064716797, ...</td>\n",
       "      <td>0.445766</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1338</th>\n",
       "      <td>ipt_17.tpb_256</td>\n",
       "      <td>1.215540</td>\n",
       "      <td>0.001443</td>\n",
       "      <td>[0.001434624, 0.001435648, 0.001435648, 0.0014...</td>\n",
       "      <td>24</td>\n",
       "      <td>0.000</td>\n",
       "      <td>[0.00064716797, 0.00064716797, 0.00064716797, ...</td>\n",
       "      <td>0.452094</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1411</th>\n",
       "      <td>ipt_14.tpb_352</td>\n",
       "      <td>1.316423</td>\n",
       "      <td>0.011471</td>\n",
       "      <td>[0.011004928, 0.0110090235, 0.01118208, 0.0111...</td>\n",
       "      <td>28</td>\n",
       "      <td>1.000</td>\n",
       "      <td>[0.022526976, 0.022532096, 0.02254131, 0.02254...</td>\n",
       "      <td>1.966970</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1414</th>\n",
       "      <td>ipt_17.tpb_256</td>\n",
       "      <td>1.316385</td>\n",
       "      <td>0.011559</td>\n",
       "      <td>[0.011276288, 0.011408384, 0.011437056, 0.0114...</td>\n",
       "      <td>28</td>\n",
       "      <td>1.000</td>\n",
       "      <td>[0.022526976, 0.022532096, 0.02254131, 0.02254...</td>\n",
       "      <td>1.951984</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1487</th>\n",
       "      <td>ipt_14.tpb_352</td>\n",
       "      <td>1.316686</td>\n",
       "      <td>0.013171</td>\n",
       "      <td>[0.012859392, 0.012862464, 0.01286656, 0.01288...</td>\n",
       "      <td>28</td>\n",
       "      <td>0.811</td>\n",
       "      <td>[0.022540288, 0.022542335, 0.022546433, 0.0225...</td>\n",
       "      <td>1.714352</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1490</th>\n",
       "      <td>ipt_17.tpb_256</td>\n",
       "      <td>1.365726</td>\n",
       "      <td>0.013216</td>\n",
       "      <td>[0.013073408, 0.013073408, 0.0130744325, 0.013...</td>\n",
       "      <td>28</td>\n",
       "      <td>0.811</td>\n",
       "      <td>[0.022540288, 0.022542335, 0.022546433, 0.0225...</td>\n",
       "      <td>1.708442</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1563</th>\n",
       "      <td>ipt_14.tpb_352</td>\n",
       "      <td>1.465889</td>\n",
       "      <td>0.017779</td>\n",
       "      <td>[0.017767424, 0.017768448, 0.017772544, 0.0177...</td>\n",
       "      <td>28</td>\n",
       "      <td>0.544</td>\n",
       "      <td>[0.022519808, 0.022535168, 0.022537217, 0.0225...</td>\n",
       "      <td>1.269554</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1566</th>\n",
       "      <td>ipt_17.tpb_256</td>\n",
       "      <td>1.516141</td>\n",
       "      <td>0.017783</td>\n",
       "      <td>[0.017772544, 0.017774591, 0.017774591, 0.0177...</td>\n",
       "      <td>28</td>\n",
       "      <td>0.544</td>\n",
       "      <td>[0.022519808, 0.022535168, 0.022537217, 0.0225...</td>\n",
       "      <td>1.269262</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1639</th>\n",
       "      <td>ipt_14.tpb_352</td>\n",
       "      <td>1.818129</td>\n",
       "      <td>0.021678</td>\n",
       "      <td>[0.021664768, 0.021665793, 0.021666817, 0.0216...</td>\n",
       "      <td>28</td>\n",
       "      <td>0.337</td>\n",
       "      <td>[0.022402048, 0.022403073, 0.022406144, 0.0224...</td>\n",
       "      <td>1.034908</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1642</th>\n",
       "      <td>ipt_17.tpb_256</td>\n",
       "      <td>1.816441</td>\n",
       "      <td>0.021494</td>\n",
       "      <td>[0.021485567, 0.021486592, 0.021486592, 0.0214...</td>\n",
       "      <td>28</td>\n",
       "      <td>0.337</td>\n",
       "      <td>[0.022402048, 0.022403073, 0.022406144, 0.0224...</td>\n",
       "      <td>1.043783</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1715</th>\n",
       "      <td>ipt_14.tpb_352</td>\n",
       "      <td>2.116900</td>\n",
       "      <td>0.024031</td>\n",
       "      <td>[0.024020992, 0.024022017, 0.024023041, 0.0240...</td>\n",
       "      <td>28</td>\n",
       "      <td>0.201</td>\n",
       "      <td>[0.022389758, 0.022416383, 0.022421503, 0.0224...</td>\n",
       "      <td>0.935401</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1718</th>\n",
       "      <td>ipt_17.tpb_256</td>\n",
       "      <td>2.066789</td>\n",
       "      <td>0.023726</td>\n",
       "      <td>[0.023716863, 0.023718912, 0.023718912, 0.0237...</td>\n",
       "      <td>28</td>\n",
       "      <td>0.201</td>\n",
       "      <td>[0.022389758, 0.022416383, 0.022421503, 0.0224...</td>\n",
       "      <td>0.947432</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1791</th>\n",
       "      <td>ipt_14.tpb_352</td>\n",
       "      <td>1.716993</td>\n",
       "      <td>0.022998</td>\n",
       "      <td>[0.022985727, 0.022989824, 0.022989824, 0.0229...</td>\n",
       "      <td>28</td>\n",
       "      <td>0.000</td>\n",
       "      <td>[0.009991168, 0.009993216, 0.009995264, 0.0099...</td>\n",
       "      <td>0.435327</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1794</th>\n",
       "      <td>ipt_17.tpb_256</td>\n",
       "      <td>1.666728</td>\n",
       "      <td>0.022663</td>\n",
       "      <td>[0.022649856, 0.022649856, 0.022652928, 0.0226...</td>\n",
       "      <td>28</td>\n",
       "      <td>0.000</td>\n",
       "      <td>[0.009991168, 0.009993216, 0.009995264, 0.0099...</td>\n",
       "      <td>0.441759</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             variant   elapsed    center  \\\n",
       "43    ipt_14.tpb_352  1.667097  0.000042   \n",
       "46    ipt_17.tpb_256  1.666077  0.000042   \n",
       "119   ipt_14.tpb_352  1.666118  0.000043   \n",
       "122   ipt_17.tpb_256  1.616790  0.000044   \n",
       "195   ipt_14.tpb_352  1.666390  0.000043   \n",
       "198   ipt_17.tpb_256  1.666235  0.000044   \n",
       "271   ipt_14.tpb_352  1.666675  0.000043   \n",
       "274   ipt_17.tpb_256  1.616154  0.000044   \n",
       "347   ipt_14.tpb_352  1.666453  0.000043   \n",
       "350   ipt_17.tpb_256  1.616455  0.000045   \n",
       "423   ipt_14.tpb_352  1.666218  0.000043   \n",
       "426   ipt_17.tpb_256  1.616859  0.000043   \n",
       "499   ipt_14.tpb_352  1.415810  0.000078   \n",
       "502   ipt_17.tpb_256  1.416047  0.000076   \n",
       "575   ipt_14.tpb_352  1.416357  0.000086   \n",
       "578   ipt_17.tpb_256  1.415771  0.000085   \n",
       "651   ipt_14.tpb_352  1.367251  0.000104   \n",
       "654   ipt_17.tpb_256  1.366859  0.000102   \n",
       "727   ipt_14.tpb_352  1.366081  0.000123   \n",
       "730   ipt_17.tpb_256  1.366657  0.000120   \n",
       "803   ipt_14.tpb_352  1.365597  0.000127   \n",
       "806   ipt_17.tpb_256  1.365572  0.000126   \n",
       "879   ipt_14.tpb_352  1.316359  0.000120   \n",
       "882   ipt_17.tpb_256  1.316560  0.000119   \n",
       "955   ipt_14.tpb_352  1.265653  0.000742   \n",
       "958   ipt_17.tpb_256  1.265422  0.000750   \n",
       "1031  ipt_14.tpb_352  1.266642  0.000843   \n",
       "1034  ipt_17.tpb_256  1.265898  0.000853   \n",
       "1107  ipt_14.tpb_352  1.265562  0.001140   \n",
       "1110  ipt_17.tpb_256  1.266333  0.001140   \n",
       "1183  ipt_14.tpb_352  1.265758  0.001382   \n",
       "1186  ipt_17.tpb_256  1.265617  0.001369   \n",
       "1259  ipt_14.tpb_352  1.265935  0.001530   \n",
       "1262  ipt_17.tpb_256  1.265464  0.001510   \n",
       "1335  ipt_14.tpb_352  1.215466  0.001463   \n",
       "1338  ipt_17.tpb_256  1.215540  0.001443   \n",
       "1411  ipt_14.tpb_352  1.316423  0.011471   \n",
       "1414  ipt_17.tpb_256  1.316385  0.011559   \n",
       "1487  ipt_14.tpb_352  1.316686  0.013171   \n",
       "1490  ipt_17.tpb_256  1.365726  0.013216   \n",
       "1563  ipt_14.tpb_352  1.465889  0.017779   \n",
       "1566  ipt_17.tpb_256  1.516141  0.017783   \n",
       "1639  ipt_14.tpb_352  1.818129  0.021678   \n",
       "1642  ipt_17.tpb_256  1.816441  0.021494   \n",
       "1715  ipt_14.tpb_352  2.116900  0.024031   \n",
       "1718  ipt_17.tpb_256  2.066789  0.023726   \n",
       "1791  ipt_14.tpb_352  1.716993  0.022998   \n",
       "1794  ipt_17.tpb_256  1.666728  0.022663   \n",
       "\n",
       "                                                samples Elements{io}[pow2]  \\\n",
       "43    [3.4816e-05, 3.4816e-05, 3.4816e-05, 3.4816e-0...                 16   \n",
       "46    [3.4816e-05, 3.4816e-05, 3.4816e-05, 3.4816e-0...                 16   \n",
       "119   [3.4816e-05, 3.4816e-05, 3.4816e-05, 3.4816e-0...                 16   \n",
       "122   [3.584e-05, 3.6864003e-05, 3.6864003e-05, 3.68...                 16   \n",
       "195   [3.584e-05, 3.584e-05, 3.584e-05, 3.584e-05, 3...                 16   \n",
       "198   [3.6864003e-05, 3.6864003e-05, 3.6864003e-05, ...                 16   \n",
       "271   [3.584e-05, 3.584e-05, 3.584e-05, 3.584e-05, 3...                 16   \n",
       "274   [3.6864003e-05, 3.6864003e-05, 3.6864003e-05, ...                 16   \n",
       "347   [3.584e-05, 3.584e-05, 3.584e-05, 3.584e-05, 3...                 16   \n",
       "350   [3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...                 16   \n",
       "423   [3.4816e-05, 3.4816e-05, 3.4816e-05, 3.4816e-0...                 16   \n",
       "426   [3.584e-05, 3.584e-05, 3.584e-05, 3.584e-05, 3...                 16   \n",
       "499   [6.9632e-05, 6.9632e-05, 6.9632e-05, 6.9632e-0...                 20   \n",
       "502   [6.8608e-05, 6.8608e-05, 6.9632e-05, 6.9632e-0...                 20   \n",
       "575   [7.8847996e-05, 7.8847996e-05, 7.8847996e-05, ...                 20   \n",
       "578   [7.7824e-05, 7.8847996e-05, 7.8847996e-05, 7.8...                 20   \n",
       "651   [9.6256e-05, 9.7280004e-05, 9.7280004e-05, 9.7...                 20   \n",
       "654   [9.5232004e-05, 9.5232004e-05, 9.5232004e-05, ...                 20   \n",
       "727   [0.000110592, 0.000111616, 0.000111616, 0.0001...                 20   \n",
       "730   [0.000109568, 0.000109568, 0.000110592, 0.0001...                 20   \n",
       "803   [0.000119808006, 0.000120832, 0.000120832, 0.0...                 20   \n",
       "806   [0.000118784, 0.000118784, 0.000118784, 0.0001...                 20   \n",
       "879   [0.00011264, 0.00011264, 0.00011264, 0.0001126...                 20   \n",
       "882   [0.000111616, 0.000111616, 0.000111616, 0.0001...                 20   \n",
       "955   [0.00071168, 0.00071168, 0.000713728, 0.000714...                 24   \n",
       "958   [0.00072499196, 0.000726016, 0.00072704, 0.000...                 24   \n",
       "1031  [0.00082841597, 0.00082944, 0.00082944, 0.0008...                 24   \n",
       "1034  [0.00083968, 0.00084172795, 0.00084172795, 0.0...                 24   \n",
       "1107  [0.001132544, 0.001133568, 0.001133568, 0.0011...                 24   \n",
       "1110  [0.001132544, 0.001132544, 0.001132544, 0.0011...                 24   \n",
       "1183  [0.001375232, 0.001375232, 0.001375232, 0.0013...                 24   \n",
       "1186  [0.001362944, 0.001362944, 0.001362944, 0.0013...                 24   \n",
       "1259  [0.0015226881, 0.0015226881, 0.0015226881, 0.0...                 24   \n",
       "1262  [0.001504256, 0.001504256, 0.001504256, 0.0015...                 24   \n",
       "1335  [0.001455104, 0.001456128, 0.001456128, 0.0014...                 24   \n",
       "1338  [0.001434624, 0.001435648, 0.001435648, 0.0014...                 24   \n",
       "1411  [0.011004928, 0.0110090235, 0.01118208, 0.0111...                 28   \n",
       "1414  [0.011276288, 0.011408384, 0.011437056, 0.0114...                 28   \n",
       "1487  [0.012859392, 0.012862464, 0.01286656, 0.01288...                 28   \n",
       "1490  [0.013073408, 0.013073408, 0.0130744325, 0.013...                 28   \n",
       "1563  [0.017767424, 0.017768448, 0.017772544, 0.0177...                 28   \n",
       "1566  [0.017772544, 0.017774591, 0.017774591, 0.0177...                 28   \n",
       "1639  [0.021664768, 0.021665793, 0.021666817, 0.0216...                 28   \n",
       "1642  [0.021485567, 0.021486592, 0.021486592, 0.0214...                 28   \n",
       "1715  [0.024020992, 0.024022017, 0.024023041, 0.0240...                 28   \n",
       "1718  [0.023716863, 0.023718912, 0.023718912, 0.0237...                 28   \n",
       "1791  [0.022985727, 0.022989824, 0.022989824, 0.0229...                 28   \n",
       "1794  [0.022649856, 0.022649856, 0.022652928, 0.0226...                 28   \n",
       "\n",
       "     Entropy                                       base_samples   speedup  \n",
       "43     1.000  [3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...  0.951220  \n",
       "46     1.000  [3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...  0.951220  \n",
       "119    0.811  [3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...  0.904762  \n",
       "122    0.811  [3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...  0.883721  \n",
       "195    0.544  [3.6864003e-05, 3.7888003e-05, 3.7888003e-05, ...  0.928571  \n",
       "198    0.544  [3.6864003e-05, 3.7888003e-05, 3.7888003e-05, ...  0.906977  \n",
       "271    0.337  [3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...  0.928571  \n",
       "274    0.337  [3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...  0.906977  \n",
       "347    0.201  [3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...  0.928571  \n",
       "350    0.201  [3.7888003e-05, 3.7888003e-05, 3.7888003e-05, ...  0.886364  \n",
       "423    0.000  [2.4576e-05, 2.4576e-05, 2.4576e-05, 2.4576e-0...  0.595238  \n",
       "426    0.000  [2.4576e-05, 2.4576e-05, 2.4576e-05, 2.4576e-0...  0.595238  \n",
       "499    1.000  [0.000110592, 0.000110592, 0.000110592, 0.0001...  1.578947  \n",
       "502    1.000  [0.000110592, 0.000110592, 0.000110592, 0.0001...  1.621621  \n",
       "575    0.811  [0.000118784, 0.000119808006, 0.000119808006, ...  1.404762  \n",
       "578    0.811  [0.000118784, 0.000119808006, 0.000119808006, ...  1.421687  \n",
       "651    0.544  [0.000119808006, 0.000119808006, 0.00011980800...  1.166667  \n",
       "654    0.544  [0.000119808006, 0.000119808006, 0.00011980800...  1.190000  \n",
       "727    0.337  [0.000117760006, 0.000118784, 0.000118784, 0.0...  0.983333  \n",
       "730    0.337  [0.000117760006, 0.000118784, 0.000118784, 0.0...  1.008547  \n",
       "803    0.201  [0.000119808006, 0.000119808006, 0.00011980800...  0.959677  \n",
       "806    0.201  [0.000119808006, 0.000119808006, 0.00011980800...  0.967480  \n",
       "879    0.000  [4.9152e-05, 4.9152e-05, 4.9152e-05, 4.9152e-0...  0.427350  \n",
       "882    0.000  [4.9152e-05, 4.9152e-05, 4.9152e-05, 4.9152e-0...  0.431034  \n",
       "955    1.000  [0.00142848, 0.001429504, 0.001431552, 0.00143...  1.962759  \n",
       "958    1.000  [0.00142848, 0.001429504, 0.001431552, 0.00143...  1.943989  \n",
       "1031   0.811  [0.001435648, 0.0014366719, 0.0014366719, 0.00...  1.730255  \n",
       "1034   0.811  [0.001435648, 0.0014366719, 0.0014366719, 0.00...  1.709484  \n",
       "1107   0.544  [0.001430528, 0.001432576, 0.001434624, 0.0014...  1.279874  \n",
       "1110   0.544  [0.001430528, 0.001432576, 0.001434624, 0.0014...  1.279874  \n",
       "1183   0.337  [0.0014172159, 0.001419264, 0.001421312, 0.001...  1.047407  \n",
       "1186   0.337  [0.0014172159, 0.001419264, 0.001421312, 0.001...  1.057592  \n",
       "1259   0.201  [0.001415168, 0.0014172159, 0.001419264, 0.001...  0.947791  \n",
       "1262   0.201  [0.001415168, 0.0014172159, 0.001419264, 0.001...  0.960000  \n",
       "1335   0.000  [0.00064716797, 0.00064716797, 0.00064716797, ...  0.445766  \n",
       "1338   0.000  [0.00064716797, 0.00064716797, 0.00064716797, ...  0.452094  \n",
       "1411   1.000  [0.022526976, 0.022532096, 0.02254131, 0.02254...  1.966970  \n",
       "1414   1.000  [0.022526976, 0.022532096, 0.02254131, 0.02254...  1.951984  \n",
       "1487   0.811  [0.022540288, 0.022542335, 0.022546433, 0.0225...  1.714352  \n",
       "1490   0.811  [0.022540288, 0.022542335, 0.022546433, 0.0225...  1.708442  \n",
       "1563   0.544  [0.022519808, 0.022535168, 0.022537217, 0.0225...  1.269554  \n",
       "1566   0.544  [0.022519808, 0.022535168, 0.022537217, 0.0225...  1.269262  \n",
       "1639   0.337  [0.022402048, 0.022403073, 0.022406144, 0.0224...  1.034908  \n",
       "1642   0.337  [0.022402048, 0.022403073, 0.022406144, 0.0224...  1.043783  \n",
       "1715   0.201  [0.022389758, 0.022416383, 0.022421503, 0.0224...  0.935401  \n",
       "1718   0.201  [0.022389758, 0.022416383, 0.022421503, 0.0224...  0.947432  \n",
       "1791   0.000  [0.009991168, 0.009993216, 0.009995264, 0.0099...  0.435327  \n",
       "1794   0.000  [0.009991168, 0.009993216, 0.009995264, 0.0099...  0.441759  "
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mean_df = tuning_df.groupby(['variant'])['speedup'].mean()\n",
    "mean_df = mean_df.reset_index()\n",
    "mean_df.columns = ['variant', 'mean_speedup']\n",
    "mean_df.sort_values(by=['mean_speedup'], ascending=False, inplace=True)\n",
    "top_avg_variants = list(mean_df[mean_df['variant'] != 'base'].head(2)['variant'])\n",
    "\n",
    "result = tuning_df[tuning_df['variant'].isin(top_avg_variants)]\n",
    "result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "8837a4869d554085a448621b944d9f3c",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "VBox(children=(HBox(children=(Dropdown(description='Elements{io}[pow2]', options=('16', '20', '24', '28'), val…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "import seaborn as sns\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "rt_axes_values = {}\n",
    "for col in merged_df.columns:\n",
    "    if '{ct}' not in col:\n",
    "        if col not in bench_columns:\n",
    "            rt_axes_values[col] = result[col].unique()\n",
    "\n",
    "rt_axes_values['variant'] = result['variant'].unique()\n",
    "\n",
    "global rt_axes_chosen_values\n",
    "rt_axes_chosen_values = {}\n",
    "\n",
    "for rt_axis in rt_axes_values:\n",
    "    rt_axes_chosen_values[rt_axis] = rt_axes_values[rt_axis][0]\n",
    "\n",
    "\n",
    "def displot():\n",
    "    display_df_loc = None \n",
    "\n",
    "    for rt_axis in rt_axes_values:\n",
    "        if display_df_loc is None:\n",
    "            display_df_loc = (result[rt_axis] == rt_axes_chosen_values[rt_axis])\n",
    "        else:\n",
    "            display_df_loc = display_df_loc & (result[rt_axis] == rt_axes_chosen_values[rt_axis])\n",
    "\n",
    "    display_df = result.loc[display_df_loc].copy()\n",
    "    samples = list(display_df['samples'])[0]\n",
    "    base_samples = list(display_df['base_samples'])[0]\n",
    "\n",
    "    sns.displot({'base': base_samples, rt_axes_chosen_values['variant']: samples}, aspect=2.)\n",
    "    plt.show()\n",
    "\n",
    "\n",
    "def on_rt_value_change(rt_axis, change):\n",
    "    global rt_axes_chosen_values\n",
    "    if change['type'] == 'change' and change['name'] == 'value':\n",
    "        rt_axes_chosen_values[rt_axis] = change['new']\n",
    "        with plot_output:\n",
    "            clear_output(wait=True)\n",
    "            displot()\n",
    "\n",
    "rt_dropdowns = []\n",
    "for rt_axis in rt_axes_values:\n",
    "    rt_dropdowns.append(create_dropdown_menu(rt_axis, rt_axes_values[rt_axis], functools.partial(on_rt_value_change, rt_axis)))\n",
    "\n",
    "plot_output = widgets.Output()\n",
    "with plot_output:\n",
    "    displot()\n",
    "\n",
    "rt_dropdown_row = widgets.HBox(rt_dropdowns)\n",
    "display(widgets.VBox([rt_dropdown_row, plot_output]))\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.6"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
